%%
%% This is file `example-plain.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xeCJK.dtx  (with options: `example-plain')
%%
%%  Version 2.4.5 (31-Jan-2012)
%%
%%  Copyright (C) Wenchang Sun <sunwch@hotmail.com>
%%
%%  This file may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%%  The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%%  and version 1.3 or later is part of all distributions of LaTeX
%%  version 2005/12/01 or later.
%%
\input xeCJK
\xeCJKsetup{CJKnumber,CJKfntef}
\punctstyle{quanjiao}
\setmainfont[
       ItalicFont={[cmunti.otf]},
         BoldFont={[cmunbx.otf]},
   BoldItalicFont={[cmunbi.otf]},
      SlantedFont={[cmunsl.otf]},
  BoldSlantedFont={[cmunbl.otf]},
    SmallCapsFont={[cmunrm.otf]:+smcp;+onum;},
BoldSmallCapsFont={[cmunbx.otf]:+smcp;+onum;}]{[cmunrm]}
\setsansfont[
       ItalicFont={[cmunsi.otf]},
         BoldFont={[cmunsx.otf]},
   BoldItalicFont={[cmunso.otf]},
      SlantedFont={[cmunss.otf]:slant=.167;},
  BoldSlantedFont={[cmunsx.otf]:slant=.167;},
    SmallCapsFont={[cmunss.otf]:+smcp;+onum;},
BoldSmallCapsFont={[cmunsx.otf]:+smcp;+onum;}]{[cmunss.otf]}
\setmonofont[
       ItalicFont={[cmunit.otf]},
         BoldFont={[cmuntb.otf]},
   BoldItalicFont={[cmuntx.otf]},
      SlantedFont={[cmuntt.otf]:slant=.167;},
  BoldSlantedFont={[cmuntb.otf]:slant=.167;},
    SmallCapsFont={[cmuntt.otf]:+smcp;+onum;},
BoldSmallCapsFont={[cmuntb.otf]:+smcp;+onum;}]{[cmuntt.otf]}
\newfontfamily\cmunrmbf{[cmunbx.otf]}
\setCJKmainfont[
       BoldFont={[simhei.ttf]},
     ItalicFont={[simkai.ttf]},
 BoldItalicFont={[simkai.ttf]:embolden=4;},
    SlantedFont={[simfang.ttf]},
BoldSlantedFont={[simfang.ttf]:embolden=4;}]{[simsun.ttc]}
\setCJKsansfont[
        BoldFont={[simyou.ttf]:embolden=4;},
     SlantedFont={[simyou.ttf]:slant=.167;},
 BoldSlantedFont={[simyou.ttf]:embolden=4;slant=.167;}]{[simyou.ttf]}
\setCJKmonofont[
        BoldFont={[simfang.ttf]:embolden=4;},
     SlantedFont={[simfang.ttf]:slant=.167;},
 BoldSlantedFont={[simfang.ttf]:embolden=4;slant=.167;}]{[simfang.ttf]}
\newCJKfontfamily\heiti{[simhei.ttf]}
\setCJKfallbackfamilyfont\CJKrmdefault
  [BoldFont={SimSun-ExtB:embolden=4;}]{SimSun-ExtB}
\normalfont
\begingroup
\cmunrmbf\heiti abc\fontspec{[simsun.ttc]:slant=.167;}abc 文字
abcabc 文\CJKfontspec{[simkai.ttf]:embolden=4;}字 abc 文字 abc
\endgroup
\bigskip
\begingroup
\def\text{\textup{ABC 文字 123}\quad\textit{ABC 文字 123}\quad
  \textsl{ABC 文字 123}\quad\textsc{abc 文字 123}\par}
\rmfamily\mdseries\text\bfseries\text
\sffamily\mdseries\text\bfseries\text
\ttfamily\mdseries\text\bfseries\text
\endgroup
\bigskip
\begingroup
\long\def\sometexts{\par
 这是 English 中文 {\itshape Chinese} 中文    \TeX\
  间隔 \textit{Italic} 中文\textbf{字体} a 数学 $b$ 数学 $c$ $d$\par
 这是English中文{\itshape Chinese}中文\TeX\
 间隔\textit{Italic}中文\textbf{字体}a数学$b$数学$c$ $d$\par
This is an example. 这是一个例子\bigskip}
\CJKsetecglue{\hskip 0.15em plus 0.05em minus 0.05em}
\sometexts
\CJKsetecglue{ }
\sometexts
\xeCJKsetup{space=true} 这 是 一行 文字。\par
\xeCJKsetup{space=false} 这 是 一行 文字。
\endgroup
\bigskip
\begingroup
\hsize 120mm    \parskip 1ex
\parindent 0em
\long\def\sometexts{%
xeCJK   改进了中英文间距的处理，并可以避免单个汉字独占一段的最后一行。

xeCJK  改进了中英文间距的处理，并且可以避免单个汉字独占一段的最后一行。

xeCJK  改进了中英文间距的处理, 并且还可以避免单个汉字独占一段的最后一行.

}
\xeCJKsetup{CJKchecksingle}
\sometexts
\bigskip
不用CJKchecksingle的效果：

\xeCJKsetup{CJKchecksingle=false}
\sometexts
\endgroup
\bigskip
\CJKunderline{汉字}\CJKunderline{加下划线加下划线加下划线加下划线加下划线加下划线加下划线加下划线加下划线加下划线加下划线}
\CJKunderwave{波浪线}
\ifcsname CJKunderanyline\endcsname
  \CJKunderanyline{0.5em}{\sixly \kern-.021em\char58 \kern-.021em}{自定义下划线}
  \CJKunderanyline{0.2em}{\kern-.03em\vtop{\kern.2ex\hrule width.2em\kern 0.11em
  \hrule height .1em}\kern-.03em}{自定义下划线}
  \CJKunderanysymbol{0.5em}{$\cdot$}{汉字加点}
\fi
\bigskip
\CJKnumber{1234567890}\par
\CJKdigits{0101011234567890}\par
\CJKdigits*{0101011234567890}
\begingroup
\bigskip
\xeCJKsetup{fallback=true}
\vbox{\tabskip=1em plus1em \offinterlineskip
\halign to .75\hsize {\strut\hfil#&\ttfamily U+#\hfil&\hfil#&
\ttfamily U+#\hfil&\hfil#&\ttfamily U+#\hfil&\hfil#&\ttfamily U+#\hfil\cr
\multispan8\hfil 漢字源𣴑考 \hfil\cr
\noalign{\medbreak\hrule\medbreak}
𠀀 & 20000 & 𠀁 & 20001 & 𠀂 & 20002 & 𠀃 & 20003 \cr
𠀄 & 20004 & 𠀅 & 20005 & 𠀆 & 20006 & 𠀇 & 20007 \cr
𠀈 & 20008 & 𠀉 & 20009 & 𠀊 & 2000A & 𠀋 & 2000B \cr
𠀌 & 2000C & 𠀍 & 2000D & 𠀎 & 2000E & 𠀏 & 2000F \cr
𠀐 & 20010 & 𠀑 & 20011 & 𠀒 & 20012 & 𠀓 & 20013 \cr
𠀔 & 20014 & 𠀕 & 20015 & 𠀖 & 20016 & 𠀗 & 20017 \cr
𠀘 & 20018 & 𠀙 & 20019 & 𠀚 & 2001A & 𠀛 & 2001B \cr
𠀜 & 2001C & 𠀝 & 2001D & 𠀞 & 2001E & 𠀟 & 2001F \cr
\noalign{\smallbreak\hrule}}}
\endgroup
\bye
\endinput
%%
%% End of file `example-plain.tex'.
